<?php

Route::group(['prefix' => 'shop', 'namespace' => 'Shop', 'as' => 'shop.'], function () {
    Route::get('/', 'HomeController@index')->name('index');


    //品牌管理
    Route::group(['prefix' => 'mark'], function () {
        Route::patch('sort_order', 'MarkController@sort_order')->name('mark.sort_order'); //排序
        Route::delete('delete_more', 'MarkController@delete_more')->name('mark.delete_more'); //删除多条
        Route::patch('change_attr', 'MarkController@change_attr')->name('mark.change_attr'); //改变属性
    });
    Route::resource('mark', 'MarkController', ['except' => 'show']);

    //商品管理
    Route::group(['prefix' => 'good'], function () {
        Route::patch('sort_order', 'GoodController@sort_order')->name('good.sort_order'); //ajax排序
        Route::patch('change_attr', 'GoodController@change_attr')->name('good.change_attr'); //改变属性
        Route::patch('stock', 'GoodController@stock')->name('good.stock'); //改变库存
        Route::delete('delete_more', 'GoodController@delete_more')->name('good.delete_more'); //删除多条
        Route::delete('destroy_gallery', 'GoodController@destroy_gallery')->name('good.destroy_gallery');

        //回收站
        Route::get('trash', 'GoodController@trash')->name('good.trash');  //回收站首页
        Route::get('/{good}/restore', 'GoodController@restore')->name('good.restore'); //还原单条
        Route::delete('/{good}/force_destroy', 'GoodController@force_destroy')->name('good.force_destroy'); //永久删除单条
        Route::delete('force_destroy_checked', 'GoodController@force_destroy_checked')->name('good.force_destroy_checked'); //永久删除多条
        Route::post('restore_checked', 'GoodController@restore_checked')->name('good.restore_checked'); //还原多条
    });
    Route::resource('good', 'GoodController');


    //商品分类
    Route::group(['prefix' => 'tag'], function () {
        Route::patch('sort_order', 'TagController@sort_order')->name('tag.sort_order'); //ajax排序
        Route::patch('change_attr', 'TagController@change_attr')->name('tag.change_attr'); //改变属性
    });
    Route::resource('tag', 'TagController');


    //会员管理
    Route::resource('customer', 'CustomerController', ['only' => ['index', 'show']]);

    //物流运费管理
    Route::group(['prefix' => 'express'], function () {
        Route::patch('sort_order', 'ExpressController@sort_order')->name('express.sort_order'); //ajax排序
        Route::patch('change_attr', 'ExpressController@change_attr')->name('express.change_attr'); //改变属性
    });
    Route::resource('express', 'ExpressController');

    //订单管理
    Route::group(['prefix' => 'order'], function () {
        Route::patch('picking', 'OrderController@picking')->name('order.picking');
        Route::patch('shipping', 'OrderController@shipping')->name('order.shipping');
        Route::patch('finish', 'OrderController@finish')->name('order.finish');
    });

    Route::resource('order', 'OrderController', ['except' => ['create', 'store']]);


});